// +FHDR------------------------------------------------------------
//                 Copyright (c) 2022 .
//                       ALL RIGHTS RESERVED
// -----------------------------------------------------------------
// Filename      : w_transaction.sv
// Author        : 
// Created On    : 2022-08-25 14:42
// Last Modified : 
// -----------------------------------------------------------------
// Description:
//
//
// -FHDR------------------------------------------------------------

`ifndef __W_TRANSACTION_SV__
`define __W_TRANSACTION_SV__

class w_transaction extends uvm_sequence_item;

    rand bit [32 -1:0] data;
    rand bit [16 -1:0] addr;
    rand int          cycle_post;
    
    `uvm_object_utils_begin(w_transaction)
        `uvm_field_int(data, UVM_ALL_ON)
        `uvm_field_int(addr, UVM_ALL_ON)
    `uvm_object_utils_end

    extern constraint data_cons;
    extern constraint addr_cons;
    extern constraint cycle_post_cons;
    
    extern function new(string name = "w_transaction");
    extern virtual function w_transaction clone();
	extern virtual function void pack();
	extern virtual function void unpack();
	
endclass: w_transaction

constraint w_transaction::data_cons{
}
constraint w_transaction::addr_cons{
}
constraint w_transaction::cycle_post_cons{
    cycle_post dist {0:/30, [1:10]:/30, [10:20]:/30};
}

function w_transaction::new(string name = "w_transaction");
	super.new(name);
endfunction

function w_transaction w_transaction::clone();
    w_transaction to = new();
    to.data = this.data;
    to.addr = this.addr;
    return to;
endfunction: clone

function void w_transaction::pack();
endfunction: pack

function void w_transaction::unpack();
endfunction: unpack

`endif
